<script type="text/javascript">
	 //页面加载的时间
    var initDate = new Date(); //防止cpu和页面其它原素(flash等)影响倒计时器的准确性,这里引入js时间
    var timeEle = document.getElementById("all_time"); 
	$(document).ready(function() {
		var stTime = getDate(initDate);
		$("#st_time").append(stTime);
		/** 绑定 释放设备 */
		$("#real_test_release").click(function() {
			releaseDev();
		});
		timmer("heartBeat()", 1000 * 120);
	});

	//得到当前时间字符串
	function getDate(d) {
		var s, t;
		s = "";
		//d = new Date();
		t = d.getHours();
		s += (t > 9 ? "" : "0") + t + ":";
		t = d.getMinutes();
		s += (t > 9 ? "" : "0") + t + ":";
		t = d.getSeconds();
		s += (t > 9 ? "" : "0") + t;
		return s;
	}

	function releaseDev() {
		var pcid = $("#sel_pcId").val();
		var imei = $("#sel_imei").val();
		$.ajax({
			type : 'POST',
			url : '/realtest.action?op=RealTest.releaseDev',
			data : {
				'rt' : Math.random(),
				'pcId' : pcid,
				'imei' : imei
			},
			dateType : 'text',
			success : function(data) {
				//关闭视频流
				try{
					closeFlashVideoStream();
				} catch(e) {
					//异常处理
				}
				/*$("#flashContent").html("");
				$("#real_test_content").html("");
				$("#real_test_content").css("display","none");
				$("#real_test_main").show();*/
				window.location.href =  "/realtest.action?op=RealTest.layout";
			},
			error : function() {
				allErrorDialog();
			}
		});
	}

	function heartBeat() {
		$.ajax({
			type : 'GET',
			url : '/ajax/realtest.action?op=RealTest.heartBeat',
			data : {
				'rt' : Math.random()
			},
			dateType : 'json',
			success : function(data) {
				return false;
			},
			error : function() {
				alert("服务出错，请稍等");
			}
		});
	}

	function timmer(handler, m) {
		window.setInterval(handler, m);
	}
</script>

<div class="content" id="real_test_content">
	<input id="sel_imei" type="hidden" name="imei">
	<input id="sel_pcId" type="hidden" name="pcId">
	<input id="sel_modelId" type="hidden" name="modelId">
	<input id="sel_picUrlB" type="hidden" name="picUrlB">
	
	<div class="page_url">
		<a href="http://www.testin.cn/portal.action?op=Portal.index">首页</a>
		<span>&gt;</span>
		<a href="#">体验测试</a>
		<span>&gt;</span>
		<strong id="real_test_content_title"></strong>
	</div>
	<div class="mobile_test_wrap">
		<div class="mobile_test clearfix">
			<table class="mobile_info">
				<col style="width:80px;" />
				<col />
				<caption>
				设备信息
				</caption>
				<tr>
					<td>
						品牌
					</td>
					<td id="real_test_content_brandName">
					</td>
				</tr>
				<tr>
					<td>
						型号
					</td>
					<td id="real_test_content_modelName">
					</td>
				</tr>
				<tr>
					<td>
						系统
					</td>
					<td id="real_test_content_syspf">
					</td>
				</tr>
				<tr>
					<td>
						网络
					</td>
					<td id="real_test_content_network">
					WIFI
					</td>
				</tr>
				<tr>
					<td>
						分辨率
					</td>
					<td id="real_test_content_dpi">
					</td>
				</tr>
				<tr>
					<td>
						所在地
					</td>
					<td id="real_test_content_area">
					</td>
				</tr>
				 
				<tr>
					<td>
						开始时间
					</td>
					<td id = "st_time">
					</td>
				</tr>
				<tr>
					<td colspan="2"><button type="button" id="real_test_release" value="">释放设备</button></td>
				</tr>
			</table>
			<div class="flash_main">
				<div id="flashScale" style="margin:0 auto;width:525px; height:708px;">
					<div id="flashContent">
					</div>
				</div>
			</div>
		</div>
	</div>
</div>